API - Cache\Writeback_cache_driver
system\cache.php at line 125

Class Writeback_cache_driver

Dynamic_cache_driver
└─Writeback_cache_driver
All Known Subclasses:
Db_cache_driver

public abstract class Writeback_cache_driver
extends Dynamic_cache_driver

Persistent cache driver that writes all entries back on script termination. Persistent cache drivers work slower but guarantee long-term data consistency.

Field Summary
protected mixed

$removed_data

Keys that are to be removed

protected array

$writeback_data

Values for delayed writeback to persistent cache

Method Summary
abstract void

flush()

Writes modified entries back to persistent storage

void

remove(string id, string realm)

Removes cache image of the object from the database

abstract bool

remove_now(string id, string realm)

Removes item immediately, avoiding writeback.

bool

store(string id, mixed data, string realm, int ttl)

Stores data as object image in cache

abstract bool

store_now(string id, mixed data, string realm, int ttl)

Writes item to cache immediately, avoiding writeback.

Methods inherited from API - Cache\Dynamic_cache_driver
store

Field Detail

system\cache.php at line 135

removed_data

protected mixed $removed_data = array()
Keys that are to be removed

system\cache.php at line 131

writeback_data

protected array $writeback_data = array()
Values for delayed writeback to persistent cache

Method Detail

system\cache.php at line 140

flush

public abstract void flush()
Writes modified entries back to persistent storage

system\cache.php at line 147

remove

public void remove(string id, string realm)
Removes cache image of the object from the database
Parameters:
id - Object identifier
realm - Realm name

system\cache.php at line 159

remove_now

public abstract bool remove_now(string id, string realm)
Removes item immediately, avoiding writeback.
Parameters:
id - Item identifier
realm - Cache realm
Returns:
See Also:
Cache_driver::remove()

system\cache.php at line 170

store

public bool store(string id, mixed data, string realm, int ttl)
Stores data as object image in cache
Parameters:
id - Object identifier
data - Object value
realm - Realm name
ttl - Time to live, 0 for unlimited
Returns:
See Also:
Cache_driver::store()

system\cache.php at line 185

store_now

public abstract bool store_now(string id, mixed data, string realm, int ttl)
Writes item to cache immediately, avoiding writeback.
Parameters:
id - Object identifier
data - Object value
realm - Realm name
ttl - Time to live, 0 for unlimited
Returns:
See Also:
Cache_driver::store()